/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import javax.persistence.Embeddable;
import javax.persistence.ManyToOne;

/**
 *
 * @author Elias Mendoza
 */
@Embeddable
public class SustratoNavePK implements Serializable{
  
  @ManyToOne
  private Sustrato sustratoFK;
  @ManyToOne
  private Nave naveFK;

  public SustratoNavePK(Sustrato sustratoFK, Nave naveFK) {
    this.sustratoFK = sustratoFK;
    this.naveFK = naveFK;
  }

  public SustratoNavePK() {
  }

  public Nave getNaveFK() {
    return naveFK;
  }

  public void setNaveFK(Nave naveFK) {
    this.naveFK = naveFK;
  }

  public Sustrato getSustratoFK() {
    return sustratoFK;
  }

  public void setSustratoFK(Sustrato sustratoFK) {
    this.sustratoFK = sustratoFK;
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    final SustratoNavePK other = (SustratoNavePK) obj;
    if (this.sustratoFK != other.sustratoFK && (this.sustratoFK == null || !this.sustratoFK.equals(other.sustratoFK))) {
      return false;
    }
    if (this.naveFK != other.naveFK && (this.naveFK == null || !this.naveFK.equals(other.naveFK))) {
      return false;
    }
    return true;
  }

  @Override
  public int hashCode() {
    int hash = 7;
    hash = 97 * hash + (this.sustratoFK != null ? this.sustratoFK.hashCode() : 0);
    hash = 97 * hash + (this.naveFK != null ? this.naveFK.hashCode() : 0);
    return hash;
  }
  
  
}
